<head>
    <meta charset="UTF-8">
<title>算法提高 质数2</title>
<link rel="stylesheet" href="../css/main.css">
</head>
 <div id="pcont1" style="margin: 20px 0px 0px; padding: 0px; font-family: 宋体, 'Times New Roman';">
<div class="pdsec" style="margin: 8px 0px 4px; padding: 4px 0px 4px 6px; font-family: 微软雅黑, 黑体, 华文细黑; font-size: 16px; font-weight: bold; border-bottom-color: rgb(187, 187, 187); border-bottom-width: 1px; border-bottom-style: solid; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; background-color: rgb(248, 248, 255);">问题描述</div>
<div class="pdcont" style="margin: 0px; padding: 0px; font-family: 'Times New Roman', 宋体; font-size: 14px; color: rgb(32, 0, 0);">　　给定一个正整数N，请你输出N以内（不包含N）的质数以及质数的个数。</div>
<div class="pdsec" style="margin: 8px 0px 4px; padding: 4px 0px 4px 6px; font-family: 微软雅黑, 黑体, 华文细黑; font-size: 16px; font-weight: bold; border-bottom-color: rgb(187, 187, 187); border-bottom-width: 1px; border-bottom-style: solid; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; background-color: rgb(248, 248, 255);">输入格式</div>
<div class="pdcont" style="margin: 0px; padding: 0px; font-family: 'Times New Roman', 宋体; font-size: 14px; color: rgb(32, 0, 0);">　　输入一行，包含一个正整数N。</div>
<div class="pdsec" style="margin: 8px 0px 4px; padding: 4px 0px 4px 6px; font-family: 微软雅黑, 黑体, 华文细黑; font-size: 16px; font-weight: bold; border-bottom-color: rgb(187, 187, 187); border-bottom-width: 1px; border-bottom-style: solid; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; background-color: rgb(248, 248, 255);">输出格式</div>
<div class="pdcont" style="margin: 0px; padding: 0px; font-family: 'Times New Roman', 宋体; font-size: 14px; color: rgb(32, 0, 0);">　　共两行。<br style="margin: 0px; padding: 0px;" />
第1行包含一个整数，表示N以内质数的个数。</div>
<div class="pdcont" style="margin: 0px; padding: 0px; font-family: 'Times New Roman', 宋体; font-size: 14px; color: rgb(32, 0, 0);">第2行包含若干个素数，每两个素数之间用一个空格隔开，素数从小到大输出。</div>
<div class="pdsec" style="margin: 8px 0px 4px; padding: 4px 0px 4px 6px; font-family: 微软雅黑, 黑体, 华文细黑; font-size: 16px; font-weight: bold; border-bottom-color: rgb(187, 187, 187); border-bottom-width: 1px; border-bottom-style: solid; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; background-color: rgb(248, 248, 255);">样例输入</div>
<div class="pddata" style="margin: 0px; padding: 0px 0px 0px 24pt; font-family: 'Courier New', FixedSys; font-size: 12pt; color: rgb(32, 0, 0);">10</div>
<div class="pdsec" style="margin: 8px 0px 4px; padding: 4px 0px 4px 6px; font-family: 微软雅黑, 黑体, 华文细黑; font-size: 16px; font-weight: bold; border-bottom-color: rgb(187, 187, 187); border-bottom-width: 1px; border-bottom-style: solid; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; background-color: rgb(248, 248, 255);">样例输出</div>
<div class="pddata" style="margin: 0px; padding: 0px 0px 0px 24pt; font-family: 'Courier New', FixedSys; font-size: 12pt; color: rgb(32, 0, 0);">4</div>
<div class="pddata" style="margin: 0px; padding: 0px 0px 0px 24pt; font-family: 'Courier New', FixedSys; font-size: 12pt; color: rgb(32, 0, 0);">2 3 5 7</div>
<div class="pdsec" style="margin: 8px 0px 4px; padding: 4px 0px 4px 6px; font-family: 微软雅黑, 黑体, 华文细黑; font-size: 16px; font-weight: bold; border-bottom-color: rgb(187, 187, 187); border-bottom-width: 1px; border-bottom-style: solid; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; background-color: rgb(248, 248, 255);">数据规模和约定</div>
<div class="pdcont" style="margin: 0px; padding: 0px; font-family: 'Times New Roman', 宋体; font-size: 14px; color: rgb(32, 0, 0);">　　N&lt;=1000</div>
</div>
<p>&nbsp;</p>
<div id="pcode" class="code" style="margin: 0px; padding: 0px; font-family: FixedSys; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">&nbsp;</div>